package com.devilvan.betrice.aiqicha.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author Evad.Wu
 * @Description 爱企查-基本信息 映射
 * @date 2022-09-23
 */
@Setter
@Getter
@ToString(exclude = {"shareholdersPoList", "directorsPoList", "investRecordPoList", "legalDocPoList", "openNoticePoList",
        "abnormalPoList", "aiqichaTradeMarkPoList", "patentPoList", "licensePoList", "tenderBiddingPoList"})
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "AIQICHA_HEADER")

@Entity
@Table(name = "AIQICHA_HEADER")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "爱企查-基本信息 映射")
public class AiqichaHeaderPo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = -6107268100136363434L;
    @Schema(description = "企业系统ID")
    @TableField(value = "PID")
    @Column(name = "PID", columnDefinition = "BIGINT(19) NOT NULL COMMENT '企业系统ID'")
    private Long pid;
    @Schema(description = "企业名称")
    @TableField(value = "ENT_NAME")
    @Column(name = "ENT_NAME", columnDefinition = "VARCHAR(128) NOT NULL COMMENT '企业名称'")
    private String entName;
    @Schema(description = "企业LOGO")
    @TableField(value = "ENT_LOGO")
    @Column(name = "ENT_LOGO", columnDefinition = "TEXT(65,535) COMMENT '企业LOGO'")
    private String entLogo;
    @Schema(description = "法定代表人ID")
    @TableField(value = "PERSON_ID")
    @Column(name = "PERSON_ID", columnDefinition = "VARCHAR(32) NOT NULL COMMENT '法定代表人ID'")
    private String personId;
    @Schema(description = "法定代表人")
    @TableField(value = "LEGAL_PERSON")
    @Column(name = "LEGAL_PERSON", columnDefinition = "VARCHAR(128) NOT NULL COMMENT '法定代表人'")
    private String legalPerson;
    @Schema(description = "手机号")
    @TableField(value = "TELEPHONE")
    @Column(name = "TELEPHONE", columnDefinition = "VARCHAR(32) COMMENT '手机号'")
    private String telephone;
    @Schema(description = "邮箱号")
    @TableField(value = "EMAIL")
    @Column(name = "EMAIL", columnDefinition = "VARCHAR(32) COMMENT '邮箱号'")
    private String email;
    @Schema(description = "法定代表人类型")
    @TableField(value = "PERSON_TITLE")
    @Column(name = "PERSON_TITLE", columnDefinition = "VARCHAR(32) COMMENT '法定代表人类型'")
    private String personTitle;
    @Schema(description = "经营状态")
    @TableField(value = "OPEN_STATUS")
    @Column(name = "OPEN_STATUS", columnDefinition = "VARCHAR(16) COMMENT '经营状态'")
    private String openStatus;
    @Schema(description = "成立日期")
    @TableField(value = "START_DATE")
    @Column(name = "START_DATE", columnDefinition = "DATETIME COMMENT '成立日期'")
    private Date startDate;
    @Schema(description = "注册资本")
    @TableField(value = "REG_CAPITAL")
    @Column(name = "REG_CAPITAL", columnDefinition = "VARCHAR(16) COMMENT '注册资本'")
    private String regCapital;
    @Schema(description = "实缴资本")
    @TableField(value = "PAIDIN_CAPITAL")
    @Column(name = "PAIDIN_CAPITAL", columnDefinition = "VARCHAR(16) COMMENT '实缴资本'")
    private String paidinCapital;
    @Schema(description = "企业LOGO")
    @TableField(value = "ANNUAL_DATE")
    @Column(name = "ANNUAL_DATE", columnDefinition = "DATETIME COMMENT '企业LOGO'")
    private Date annualDate;
    @Schema(description = "统一社会信用代码")
    @TableField(value = "UNIFIED_CODE")
    @Column(name = "UNIFIED_CODE", columnDefinition = "VARCHAR(64) NOT NULL COMMENT '统一社会信用代码'")
    private String unifiedCode;
    @Schema(description = "组织机构代码")
    @TableField(value = "ORG_NO")
    @Column(name = "ORG_NO", columnDefinition = "VARCHAR(64) COMMENT '组织机构代码'")
    private String orgNo;
    @Schema(description = "纳税人识别号")
    @TableField(value = "TAX_NO")
    @Column(name = "TAX_NO", columnDefinition = "VARCHAR(64) NOT NULL COMMENT '纳税人识别号'")
    private String taxNo;
    @Schema(description = "企业类型")
    @TableField(value = "ENT_TYPE")
    @Column(name = "ENT_TYPE", columnDefinition = "VARCHAR(64) NOT NULL COMMENT '企业类型'")
    private String entType;
    @Schema(description = "营业期限")
    @TableField(value = "OPEN_TIME")
    @Column(name = "OPEN_TIME", columnDefinition = "VARCHAR(64) COMMENT '营业期限'")
    private String openTime;
    @Schema(description = "工商注册号")
    @TableField(value = "REG_CODE")
    @Column(name = "REG_CODE", columnDefinition = "VARCHAR(64) COMMENT '工商注册号'")
    private String regCode;
    @Schema(description = "所属行业")
    @TableField(value = "INDUSTRY")
    @Column(name = "INDUSTRY", columnDefinition = "VARCHAR(64) NOT NULL COMMENT '所属行业'")
    private String industry;
    @Schema(description = "登记机关")
    @TableField(value = "AUTHORITY")
    @Column(name = "AUTHORITY", columnDefinition = "VARCHAR(64) COMMENT '登记机关'")
    private String authority;
    @Schema(description = "行政区划")
    @TableField(value = "DISTRICT")
    @Column(name = "DISTRICT", columnDefinition = "VARCHAR(64) COMMENT '行政区划'")
    private String district;
    @Schema(description = "行政区划编码")
    @TableField(value = "DISTRICT_CODE")
    @Column(name = "DISTRICT_CODE", columnDefinition = "VARCHAR(64) COMMENT '行政区划编码'")
    private String districtCode;
    @Schema(description = "参保人数")
    @TableField(value = "INSURANCE_NUM")
    @Column(name = "INSURANCE_NUM", columnDefinition = "VARCHAR(16) COMMENT '参保人数'")
    private String insuranceNum;
    @Schema(description = "参保年限")
    @TableField(value = "INSURANCE_YEAR")
    @Column(name = "INSURANCE_YEAR", columnDefinition = "VARCHAR(64) COMMENT '参保年限'")
    private String insuranceYear;
    @Schema(description = "注册地址")
    @TableField(value = "REG_ADDR")
    @Column(name = "REG_ADDR", columnDefinition = "TEXT(65,535) COMMENT '注册地址'")
    private String regAddr;
    @Schema(description = "经营范围")
    @TableField(value = "SCOPE")
    @Column(name = "SCOPE", columnDefinition = "TEXT(65,535) COMMENT '经营范围'")
    private String scope;

    @Schema(description = "股东信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaShareholdersPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaShareholdersPo> shareholdersPoList;
    @Schema(description = "主要人员信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaDirectorsPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaDirectorsPo> directorsPoList;
    @Schema(description = "对外投资信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaInvestRecordPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaInvestRecordPo> investRecordPoList;
    @Schema(description = "裁决文书信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaLegalDocPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaLegalDocPo> legalDocPoList;
    @Schema(description = "开庭公告信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaOpenNoticePo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaOpenNoticePo> openNoticePoList;
    @Schema(description = "开庭公告信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaAbnormalPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaAbnormalPo> abnormalPoList;
    @Schema(description = "商标信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaTradeMarkPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaTradeMarkPo> aiqichaTradeMarkPoList;
    @Schema(description = "专利信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaPatentPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaPatentPo> patentPoList;
    @Schema(description = "行政许可信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaLicensePo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaLicensePo> licensePoList;
    @Schema(description = "招/投标信息")
    @TableField(exist = false)
    @OneToMany(targetEntity = AiqichaTenderBiddingPo.class, mappedBy = "aiqichaHeaderPo", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<AiqichaTenderBiddingPo> tenderBiddingPoList;
}
